package com.sk.sk_frame_cloud.controller;


import com.sk.sk_frame_cloud.annotation.EnterPathParamLog;
import com.sk.sk_frame_cloud.param.SysRolePermissionParam;
import com.sk.sk_frame_cloud.res.CommonResponse;
import com.sk.sk_frame_cloud.service.ISysRolePermissionRelationService;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 *  角色权限关系表
 * @author jiaok
 * @since 2023-04-04 19:46:07
 */
@RestController
@RequestMapping("sys-role-permission-relation")
public class SysRolePermissionRelationController {

    @Resource
    private ISysRolePermissionRelationService permissionRelationService;



    /**
     * 更新角色的权限
     *
     * @param permissionParam
     * @return
     */
    @ApiOperation("更新指定角色的权限")
    @PostMapping("update")
    @EnterPathParamLog
    public CommonResponse<String> update(@RequestBody @Validated SysRolePermissionParam permissionParam) {
        return permissionRelationService.updateRolePermission(permissionParam);
    }


}

